package com.letoken.platform.repo.mall.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.letoken.platform.repo.admin.req.mall.AccelerateDetailReq;
import com.letoken.platform.repo.admin.req.mall.MallIssueRelordReq;
import com.letoken.platform.repo.admin.res.mall.AccelerateDetailRes;
import com.letoken.platform.repo.admin.res.mall.MallIssueRelordRes;
import com.letoken.platform.repo.mall.po.AppMallIssueRecord;
import com.letoken.platform.repo.mall.po.MallIssueRecord;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 用户商城消费发型记录 Mapper 接口
 * </p>
 *
 * @author 作者
 * @since 2023-04-20
 */
public interface MallIssueRecordsMapper extends BaseMapper<MallIssueRecord> {
    BigDecimal getMallIssueAmout(@Param("type")Integer type, @Param("time")String time);

    BigDecimal  getMallIssueAmoutWait();
    Page<MallIssueRelordRes> getMallIssueDetail(@Param("page") Page<MallIssueRelordRes> page, @Param("req") MallIssueRelordReq req);


    BigDecimal getAccelerateTime(@Param("time") String time);

    Page<AccelerateDetailRes> getAccelerateDetail(@Param("page") Page<AccelerateDetailRes> page, @Param("req") AccelerateDetailReq req);

    @Select("select * from app_mall_issue_record where wait_circulation>0")
    List<AppMallIssueRecord> getWaitCirculation(@Param("userId")Integer userId);

}
